// 9*9乘法表
;(function fn() {
  let str = ''
  for (let i = 1; i <= 9; i++) {
    str += `<div class="row">`
    for (let j = 1; j <= i; j++) {
      str += `<span>${i}×${j}=${i * j}</span>`
    }
    str += `</div>`
  }
  console.log(str)
  document.getElementsByClassName('box')[0].innerHTML = str
})()

// 10*10 矩阵
;(() => {
  let str = ''
  for (let i = 0; i < 10; i++) {
    str += `<div class="item">`
    for (let j = 0; j < 10; j++) {
      str += `<span>*</span>`
    }
    str += `</div>`
  }
  document.getElementsByClassName('content')[0].innerHTML = str
})()

// 10层的直角三角形
;(() => {
  let str = ''
  for (let i = 0; i < 10; i++) {
    str += `<div class="item">`
    for (let j = 0; j <= i; j++) {
      str += `<span>*</span>`
    }
    str += `</div>`
  }
  document.getElementsByClassName('temp')[0].innerHTML = str
})()
